<!DOCTYPE html>
<html>
  <head>
    <title>jquery.rss zotero example</title>

    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">

    <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
    <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
    <script src="../src/jquery.rss.js"></script>

    <script>
      var readTokenFromResponse = function(response, attr) {
        return $(response).find('tr th:contains(' + attr + ')').parent().find('td').text()
      }
      jQuery(function($) {
        $("#rss-feeds").rss("https://api.zotero.org/groups/9097/items/top?start=0&limit=55&format=atom", {
          entryTemplate: "<ul><li>Title: {title}</li><li>Author: {author}</li><li>Year: {year}</li></ul><br>",
          tokens: {
            year: function(entry, tokens) {
              return new Date(entry.publishedDate).getFullYear()
            }
          }
        })
      })
    </script>
  </head>
  <body>
    <div>
      <h1>jquery.rss zotero example</h1>
      <div id="rss-feeds"></div>
    </div>
  </body>
</html>
